'use strict';

window.onload = function() {
  console.log('window:', window);
  var allNews = document.getElementById('allNews');
  var allEvents = document.getElementById('allEvents');
  var books = document.getElementById('books');
  var patents = document.getElementById('patents');
  var journals = document.getElementById('journals');
  var intro = document.getElementById('intro');
  var tan = document.getElementById('tan');
  var faculty = document.getElementById('faculty');
  var fellows = document.getElementById('fellows');
  var phd = document.getElementById('phd');
  var ms = document.getElementById('ms');
  var alumni = document.getElementById('alumni');
  // var calendarWrapper = document.getElementById('calendar-wrapper');

  // var changeToEvent = false;

  allNews && allNews.addEventListener('click', function() {
    // changeToEvent = false;
    // calendarWrapper.style.display = 'none';
    window.location.href = "/news";
  });

  allEvents && allEvents.addEventListener('click', function() {
    // changeToEvent = true;
    // calendarWrapper.style.display = 'block';
    window.location.href = "/events";
  });

  books && books.addEventListener('click', function() {
    window.location.href = "/books";
  });

  patents && patents.addEventListener('click', function() {
    window.location.href = "/patents";
  });

  journals && journals.addEventListener('click', function() {
    window.location.href = "/publication";
  });

  intro && intro.addEventListener('click', function() {
    window.location.href = "/members";
  });

  tan && tan.addEventListener('click', function() {
    window.location.href = "/tan";
  });

  faculty && faculty.addEventListener('click', function() {
    window.location.href = "/faculty_staff";
  });

  fellows && fellows.addEventListener('click', function() {
    window.location.href = "/fellows";
  });

  phd && phd.addEventListener('click', function() {
    window.location.href = "/phd";
  });

  ms && ms.addEventListener('click', function() {
    window.location.href = "/ms";
  });

  alumni && alumni.addEventListener('click', function() {
    window.location.href = "/alumni";
  });

};
